<?php
namespace Managers;
use \Site\TypeHousing as TypeHousingEntity;

class TypeHousing extends BaseManager{
    public function getAll(){
        return $this->getEntityManager()
                ->createQueryBuilder()
                ->select('n')
                ->from('Site\Areas', 'n')
                ->orderBy('n.id', '')
                ->getQuery()
                ->getResult();
    }

    public function getOne($type, $id){
        return $this->getEntityManager()
                ->createQueryBuilder()
                ->select('n')
                ->from('Site\TypeHousing', 'n')
                ->where('n.id = :id')
                ->andwhere('n.type = :type')
                ->getQuery()
                ->setParameters(array('id'=>$id, 'type'=>$type))
                ->getSingleResult();
    }

}
